<template>
	<view class="qualificationInformation">
		<view class="top">
			<view class="left">
				<image :src="data.httpUrl+'/app/file/viewFile?fileId='+data.info.logFileId" mode="aspectFill">
				</image>
			</view>
			{{data.info.storeName}}
		</view>
		<view class="qualifications">
			<view class="idCart">
				身份证
				<view class="bot">
					<view class="" v-if="data.info.certFrontFile">
						<view class="">
							<image :src="data.httpUrl+'/app/file/viewFile?fileId='+data.info.certFrontFile"
								mode="aspectFill"></image>
						</view>
						身份证人像面
					</view>
					<view class="" v-if="data.info.certBackFile">
						<view class="">
							<image :src="data.httpUrl+'/app/file/viewFile?fileId='+data.info.certBackFile"
								mode="aspectFill"></image>
						</view>
						身份证国徽面
					</view>
				</view>

			</view>
			<view class="yyzz" v-if="data.info.mainType.value == 'COMPANY'">
				营业执照({{data.info.licenceFile?1:0}}/1)
				<view class="">
					<image :src="data.httpUrl+'/app/file/viewFile?fileId='+data.info.licenceFile" mode="aspectFill">
					</image>
				</view>
			</view>
			<view class="xgzz" v-if="data.info.mainType.value == 'COMPANY'">
				相关资质({{data.info.otherLicence.length || 0}}/20)
				<view class="">
					<view class="" v-for="(item,index) in data.info.otherLicence" :key="index">
						<image :src="data.httpUrl+'/app/file/viewFile?fileId='+item" mode="aspectFill"></image>
					</view>
				</view>

			</view>
		</view>
	</view>
</template>

<script setup lang="ts">
	import { otherStoreInfo } from '@/utils/api/goods'
	import { reactive } from 'vue';
	import { onLoad } from '@dcloudio/uni-app';
	const data = reactive<any>({
		info: '',
		httpUrl: getApp().globalData.baseUrl,
	})
	onLoad(({storeId})=>{
		otherStoreInfo({data:{storeId}}).then((res) => {
			res.data.otherLicence = JSON.parse(res.data.otherLicence)
			data.info = res.data;
		})
	})
	
</script>

<style lang="scss">
	.qualificationInformation {
		height: 100vh;
		display: flex;
		flex-direction: column;
		background: #F4F6FA;

		.qualifications {
			color: #8C8C8C;
			padding: 0 24rpx;
			margin-top: 24rpx;

			image {
				width: 100%;
				height: 100%;
			}

			.idCart {
				padding: 24rpx 32rpx;
				border-radius: 20rpx;
				background: #fff;
				margin-top: 20rpx;

				.bot {
					display: flex;
					justify-content: space-between;

					>view {
						display: flex;
						flex-direction: column;
						align-items: center;
						justify-content: center;
						width: 300rpx;
						font-size: 24rpx;
						color: #8C8C8C;
						margin-top: 16rpx;

						view {
							border-radius: 20rpx;
							background: #ccc;
							height: 180rpx;
							margin-bottom: 8rpx;
							width: 100%;

						}
					}
				}


			}

			.yyzz {
				padding: 24rpx 32rpx;
				border-radius: 20rpx;
				background: #fff;
				margin-top: 20rpx;

				view {
					height: 240rpx;
					margin-top: 20rpx;
					border-radius: 20rpx;
					border: 2rpx dashed #F4F6FA;
				}
			}

			.xgzz {
				padding: 24rpx 32rpx;
				border-radius: 20rpx;
				background: #fff;
				margin-top: 20rpx;

				>view {
					display: flex;
					flex-wrap: wrap;

					view {
						height: 200rpx;
						width: 32%;
						background: #ccc;
						margin-top: 16rpx;
						border-radius: 12rpx;
						margin-right: 2%;
					}

					>view:nth-of-type(3n) {
						margin-right: 0;
					}
				}
			}
		}

		>.top {
			padding: 16rpx 32rpx;
			background: #fff;
			display: flex;
			align-items: center;
			font-size: 36rpx;

			.left {
				width: 128rpx;
				height: 128rpx;
				border-radius: 50%;
				background: #ccc;
				margin-right: 24rpx;
				image{
					width: 100%;
					height: 100%;
					border-radius: 50%;
				}
			}
		}
	}
</style>